package com.qf.service.impl;

import com.qf.entity.User;
import com.qf.entity.UserVO;
import com.qf.mapper.UserMapper;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public UserVO findUserWithOrdersById(int id) {
        return userMapper.findUserWithOrdersById(id);
    }

    @Override
    public User findUserById(int id) {
        return userMapper.findUserById(id);
    }

    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public User loginByUsernameAndPassword(String username, String password) {
        return userMapper.loginByUsernameAndPassword(username,password);
    }

    @Override
    public List<User> findUserByMap(Map<String, Object> map) {
        return userMapper.findUserByMap(map);
    }

    @Override
    public List<User> SearchUserByMap(HashMap<String, String> map) {
        return userMapper.SearchUserByMap(map);
    }

    @Override
    public boolean deleteByIds(List<Integer> ids) {
        return userMapper.deleteByIds(ids);
    }

    @Override
    public void updateUserBySet(User user) {
        userMapper.updateUserBySet(user);
    }
}
